<app:page xmlns:h="http://java.sun.com/jsf/html"
          xmlns:app="http://java.sun.com/jsf/composite/app"
          xmlns:ds="http://deltaset.org/deltaset-faces"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:c="http://java.sun.com/jsp/jstl/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          id="offerRide-page"
          pageTitle="#{offerRideMsg['view.title']}">

    <ds:titlebar title="#{offerRideMsg['view.title']}">
        <h:button outcome="/secured/offerRide/form" 
                  value="#{deltasetMessages['deltaset.crud.add']}"
                  styleClass="ds-button"/>
        <h:button outcome="/secured/offerRide/list" 
                  value="#{deltasetMessages['deltaset.crud.list']}"
                  styleClass="ds-button"/>
    </ds:titlebar>
    <c:set target="#{viewScope}" property="offerRideModel" value="#{offerRideBean.loadModel(param.offerRideId)}"/>

    <ds:fieldset>

        <ds:outputText label="#{offerRideMsg['description']}" value="#{viewScope.offerRideModel.description}"/>
        <ds:outputDate label="#{offerRideMsg['startTime']}" value="#{viewScope.offerRideModel.startTime}"/>
        <ds:outputText label="#{offerRideMsg['repeatType']}" value="#{viewScope.offerRideModel.repeatType}"/>
        <ds:outputText label="#{offerRideMsg['rideState']}" value="#{viewScope.offerRideModel.rideState}"/>
    </ds:fieldset>
    

    <ui:include src="/secured/transport/many-to-one.xhtml">
        <ui:param name="transportModel" value="#{viewScope.offerRideModel.transportWith}"/>
    </ui:include>        


    <ui:include src="/secured/address/many-to-one.xhtml">
        <ui:param name="addressModel" value="#{viewScope.offerRideModel.startAddress}"/>
    </ui:include>        


    <ui:include src="/secured/address/many-to-one.xhtml">
        <ui:param name="addressModel" value="#{viewScope.offerRideModel.endAddress}"/>
    </ui:include>        


    <ui:include src="/secured/user/many-to-one.xhtml">
        <ui:param name="userModel" value="#{viewScope.offerRideModel.offeredBy}"/>
    </ui:include>        

     
    
    <div class="ds-margin-top">
        <h:button outcome="/secured/offerRide/form" 
                  value="#{deltasetMessages['deltaset.crud.edit']}"
                  styleClass="ds-button">
            <f:param name="offerRideId" value="#{viewScope.offerRideModel.id}"/>
        </h:button>
        <h:form>
            <h:commandButton value="#{deltasetMessages['deltaset.crud.delete']}"
                             action="#{offerRideBean.delete(viewScope.offerRideModel)}"
                             onclick="return deltaset.confirm(this)"
                             styleClass="ds-button">
                <f:param name="offerRideId" value="#{viewScope.offerRideModel.id}"/>
            </h:commandButton>
        </h:form>
    </div>

 

</app:page>